FROM kitsudo/python36
MAINTAINER Dave Luo <kitsudo163@163.com>
# 默认的一些基本库
RUN pip3 install --trusted-host mirrors.aliyun.com -i http://mirrors.aliyun.com/pypi/simple redis requests xlrd autobahn 

RUN cd /tmp && \
    wget https://pypi.python.org/packages/d2/5d/ed5071740be94da625535f4333793d6fd238f9012f0fee189d0c5d00bd74/Twisted-17.1.0.tar.bz2 && \
    pip3 install Twisted-17.1.0.tar.bz2 && \
    echo "Twisted"

# 额外的扩展库
RUN pip3 install --trusted-host mirrors.aliyun.com -i http://mirrors.aliyun.com/pypi/simple redis requests xlrd autobahn SQLAlchemy PyMySQL Jinja2 objgraph qrcode Pillow click gevent simplejson uwsgi
# 2nd
RUN pip3 install --trusted-host mirrors.aliyun.com -i http://mirrors.aliyun.com/pypi/simple requests-futures
RUN yum install -y gcc-c++ ice-all-runtime ice-all-devel && yum clean all && pip3.6 install zeroc-ice --trusted-host mirrors.aliyun.com -i http://mirrors.aliyun.com/pypi/simple
# 稳住时差
RUN /bin/cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 导入证书
# tar c id_rsa id_rsa.pub|gzip |base64 -w 0
RUN mkdir -p /root/.ssh && cd /root/.ssh && echo "H4sIADJqklkAA+3Wx86kyhkG4FlzFf8eHRMbmsWRTOwmhyZvLFI3OUMDV396ZnaOG48tyzwSKkEh8amqqHqL9C/jFH37peAPAoZ/tPDfthiKkN8QDMFxFMc+1zcYgUkM//YF/9qyflqmORq/vr6NXTf/s/f+Vf//qN++Y/ibqH1ZD/rLsESXtvkvmQ9+9ACqKPI9LTI0LbO0ydMwaxHy6LhTMnXb8GQ8RGQnAmq2Qwivy55fyiau78tSq6uWq04OzFJMvTGqh5eXI8GNUBOgciWGKorMzZdEnLpvtkdQMJUOwUbCTgJte92486FhTz0sAgBK7NrOEc8SFTedLy8EwsvJL/R5f0fglGK11e+pg5KSZ4yxa0VZbcGtL9+Ejt1jsSOBTUWshxHpRhP08q0jkQOu9TeiZG8Gnwu6feDmv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MFyuMRRGg0W0crBU80EsE/h8eIYvya9oyFmL9iwotYxiHRMMdYu71IaCn5p7e8GEBwisBa26eoDz0NPTtNhspny60YY2Nhds7KnZada5D1fw7Xrk1GaTOu5s7qULBSsTu2sSkIXwQZgy8zI5+V4ulv3QFbK6XjrXTffFlAhBZ2N8hXPiM1X09pzWiSTNjIzi3J7HOwNslsfG73K64LsRvZBCveuC20YZAfW9iM2BNfCiGGubo+EI3+6UqxQNy1atuaX+Wis9UJhj3MrHkPhDNrsvdHosXCmC9DN5VFw/yK5JVaEqZmHBKvX7GXoBCJGv338HfhwrvMb9/ePmv30c/t8pfuS/P/VL/Ou+8SP/4fg/yn+fbEj8Vf5DLhh85r//hGnKf/ssgC/6g8G0I2KRPUH577c/48jnMW1ypnTvhtnytn0vb/1ViJ2XfIxgfFfddifle6OHi5MRhLNfUX573OB6xbgn2j4IxmwfgeeP+HoMg9X3nJBUZQk/BS0eMRtB+/K+WtYB3WUv9DAVS6+XRiqpTXf1uxvyr9lFsYbzoULfMpHAFGYkNixzb62E2PFUB+A8u0JPuPdHmnSB91KkqShX/nAFkepwMCyqLipX33g4JOfMJH0vUJFNlZyTSabHSbvYyBvWXfZDUHSOE+DYx7P8YNOEU7qb3R8uHYzOCk+dfYUl8EXbGHnl6Cp2BJSSadvwbqPCt5HtR8ccv0Ecz1l+NjLI0cphddqWDBtiXtUyWeHELaHi4UMUxyGxqIRf39fUn8sUObe90+l0Op1Op9PpdDqdTqfT6XQ6nU6n07/JH13i8I8AKAAA" | base64 -d | tar zxv
# 屏蔽ssh的登录提示
RUN mkdir -p ~/.ssh && echo "StrictHostKeyChecking no" >> ~/.ssh/config && echo "UserKnownHostsFile /dev/null" >> ~/.ssh/config
# 全局的提交配置
RUN git config --global user.name "deploy" && git config --global user.email deploy@dayun-inc.com
# 全局的ignore配置
RUN echo "*.pyc" >> /root/.gitignore_global && git config --global core.excludesfile /root/.gitignore_global
# 默认的环境配置
ENV WORKDIR=/app/server
ENV LOG_PATH=/var/log/server
ENV PASS_REQUIREMENTS=TRUE
ENV GIT=git@git.oschina.net:BuShuZhuanYong/wawa_server.git
ENV VIRTUAL_PORT=8080
COPY docker-entrypoint.sh /root/
COPY .func.sh /deploy/
COPY sleep.sh /deploy/
COPY pass.sh /deploy/
EXPOSE 8080
RUN chmod a+x /root/docker-entrypoint.sh
WORKDIR /app
ENTRYPOINT /root/docker-entrypoint.sh
